home *** CD-ROM | disk | FTP | other *** search
- # Commands covered: lsort
- #
- # This file contains a collection of tests for one or more of the Tcl
- # built-in commands. Sourcing this file into Tcl runs the tests and
- # generates output for errors. No output means no errors were found.
- #
- # Copyright 1991 Regents of the University of California
- # Permission to use, copy, modify, and distribute this
- # software and its documentation for any purpose and without
- # fee is hereby granted, provided that this copyright notice
- # appears in all copies. The University of California makes no
- # representations about the suitability of this software for any
- # purpose. It is provided "as is" without express or implied
- # warranty.
- #
- # $Header: /sprite/src/lib/tcl/tests/RCS/lsort.test,v 1.1 91/08/21 13:37:25 ouster Exp $ (Berkeley)
-
- if {[string compare test [info procs test]] == 1} then {source defs}
-
- test lsort-1.1 {lsort command} {
- lsort {abdeq ab 1 ac a}
- } {1 a ab abdeq ac}
- test lsort-1.2 {lsort command} {
- lsort {{one long element}}
- } {{one long element}}
- test lsort-1.3 {lsort command} {
- lsort {}
- } {}
- test lsort-1.4 {lsort with characters needing backslashes} {
- lsort {$ \\ [] \{}
- } {{$} {[]} \\ \{}
-
- test lsort-2.1 {lsort errors} {
- list [catch lsort msg] $msg
- } {1 {wrong # args: should be "lsort list"}}
- test lsort-2.2 {lsort errors} {
- list [catch {lsort a b} msg] $msg
- } {1 {wrong # args: should be "lsort list"}}
- test lsort-2.3 {lsort errors} {
- list [catch {lsort "\{"} msg] $msg
- } {1 {unmatched open brace in list}}
-